#!/bin/sh

download() {
  wget -c $1
  if [[ ! $? ]] ; then
    echo "trouble downloading $1, fix your connection. will sleep for 10 sec and loop until it works."
    sleep 10
    download $1
  fi
}

# tarxf http://server/path/to/ file-1 .tar.gz [dirname]
tarxf() {
  cd $S
  [ -f $2$3 ] || download $1$2$3
  rm -rf ${4:-$2}
  tar xf $2$3
  cd ${4:-$2}
}
